{
irq_desc_t *desc = &irq_desc[irq];
irq_guest_action_t *action = (irq_guest_action_t *)desc->action;
- struct domain *p;
+ struct domain *d;
int i;
for ( i = 0; i < action->nr_guests; i++ )
{
- p = action->guest[i];
- if ( !test_and_set_bit(irq, &p->pirq_mask) )
+ d = action->guest[i];
+ if ( !test_and_set_bit(irq, &d->pirq_mask) )
action->in_flight++;
- send_guest_pirq(p, irq);
+ send_guest_pirq(d, irq);
}
}
-int pirq_guest_unmask(struct domain *p)
+int pirq_guest_unmask(struct domain *d)
{
irq_desc_t *desc;
int i, j, pirq;
u32 m;
- shared_info_t *s = p->shared_info;
+ shared_info_t *s = d->shared_info;
- for ( i = 0; i < 2; i++ )
+ for ( i = 0; i < ARRAY_SIZE(d->pirq_mask); i++ )
{
- m = p->pirq_mask[i];
+ m = d->pirq_mask[i];
while ( (j = ffs(m)) != 0 )
{
m &= ~(1 << --j);
pirq = (i << 5) + j;
desc = &irq_desc[pirq];
spin_lock_irq(&desc->lock);
- if ( !test_bit(p->pirq_to_evtchn[pirq], &s->evtchn_mask[0]) &&
- test_and_clear_bit(pirq, &p->pirq_mask) &&
+ if ( !test_bit(d->pirq_to_evtchn[pirq], &s->evtchn_mask[0]) &&
+ test_and_clear_bit(pirq, &d->pirq_mask) &&
(--((irq_guest_action_t *)desc->action)->in_flight == 0) )
desc->handler->end(pirq);
spin_unlock_irq(&desc->lock);
return 0;
}
-int pirq_guest_bind(struct domain *p, int irq, int will_share)
+int pirq_guest_bind(struct domain *d, int irq, int will_share)
{
irq_desc_t *desc = &irq_desc[irq];
irq_guest_action_t *action;
unsigned long flags;
int rc = 0;
- if ( !IS_CAPABLE_PHYSDEV(p) )
+ if ( !IS_CAPABLE_PHYSDEV(d) )
return -EPERM;
spin_lock_irqsave(&desc->lock, flags);
/* Attempt to bind the interrupt target to the correct CPU. */
if ( desc->handler->set_affinity != NULL )
desc->handler->set_affinity(
- irq, apicid_to_phys_cpu_present(p->processor));
+ irq, apicid_to_phys_cpu_present(d->processor));
}
else if ( !will_share || !action->shareable )
{
goto out;
}
- action->guest[action->nr_guests++] = p;
+ action->guest[action->nr_guests++] = d;
out:
spin_unlock_irqrestore(&desc->lock, flags);
return rc;
}
-int pirq_guest_unbind(struct domain *p, int irq)
+int pirq_guest_unbind(struct domain *d, int irq)
{
irq_desc_t *desc = &irq_desc[irq];
irq_guest_action_t *action;
action = (irq_guest_action_t *)desc->action;
- if ( test_and_clear_bit(irq, &p->pirq_mask) &&
+ if ( test_and_clear_bit(irq, &d->pirq_mask) &&
(--action->in_flight == 0) )
desc->handler->end(irq);
else
{
i = 0;
- while ( action->guest[i] != p )
+ while ( action->guest[i] != d )
i++;
memmove(&action->guest[i], &action->guest[i+1], IRQ_MAX_GUESTS-i-1);
action->nr_guests--;